One of the most intricate problems in on-camera color processing involves accurate compensation for changing spectra of scene illumination. This problem, also known as white balancing, stems from the fact that frequently occurring in practice illumination sources have significantly different spectral characteristics. In the absence of proper real-time compensation, the color of the imagery from video cameras would be changing with change in illumination spectra.
One of the strongest factors affecting spectral emission of most illuminators is its temperature. According to Plank's law, illuminators with higher temperature emit more energy at shorter wavelengths. From the point of view of imaging applications, hotter illuminators can be considered “blue”, while colder sources can be considered “red”. As a practical example, in the absence of compensation, images illuminated by the sunlight (blue-rich illuminator) appear bluish as compared to the images of the same scene being illuminated by the incandescent light.
Human brain, apparently, is capable of inferring the illumination spectra and performing the required compensation leading to the similar color perception of the same scene under wide range of illuminators. In the case of digital video cameras, proper color rendition can only be achieved if current spectra of illumination is determined and compensated for in real time. In practice this process can conceptually be broken into two distinct steps: gathering appropriate image statistics to estimate the spectra of illumination and performing the appropriate adjustment of color channel gains and/or color correction matrix applied to the image.
The difficulty in estimating the effects of illumination on the image color from the analysis of the image itself stems from the need to distinguish between overall color shift of the image that is due to specific illumination and that due to the presence of large monochrome objects. For example, accurate white balance algorithm needs to determine whether the image is bluish due to sunlight illumination or due to the presence of large blue-colored objects in the scene, wherein sunlight illumination requires the compensation, while no additional compensation is necessary in the later case.
Perhaps the simplest practical scheme for estimating the adjustment necessary to compensate for the effects of changing spectra of illumination is known as “gray world” model. Under “gray world” model it is assumed that in properly balanced image average values of red, green and blue components should be equal to each other due to the wide variety of colors present in “typical” scenes. It is assumed that color shift introduced by the specific spectra of scene illumination will be compensated once averages of all color components of the image are equalized by adjusting color channel gains of the camera.
While “gray world” approach works reasonably well for certain images, it fails for images dominated by monochrome objects, such as green grass or blue sky. There exist somewhat more sophisticated white balance algorithms that attempt to circumvent this problem by restricting statistics gathering only to pixels and areas of the image that are “close” to being gray or have small chrominance values. However, even that approach fails to produce proper white balance under many conditions. For example, if blue object in the image previously white balanced for sunlight is illuminated by red-rich incandescent light, then that blue object will appear grey, having small magnitudes of chrominance values and, therefore, will incorrectly contribute to the white balance statistics.